﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="syc._Default" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>生产管理系统</title>
<base target="contents"/>
<link href="PanelBar/PanelBar.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" language="javascript" src="PanelBar/PanelBar.js"></script>
</head>
<body scroll="no" onselectstart="return(true);">
<div id="tooltip" style="display:none;position: absolute; width: 143px; height: 42px; z-index: 2; left: 5px; top: 430px; background-image:url(/images/showMenu.gif); filter:Alpha(opacity=90);opacity:0.9"></div>
<script type="text/javascript" language="javascript" src="common.js"></script>
<script type="text/javascript" language="javascript">
    function hideTooltip() {
        tooltipOpacity-=10;

        if (tooltipOpacity > 0) {
            if (tooltip.style.filter) {
                tooltip.style.filter = "Alpha(opacity=" + tooltipOpacity + ")";
            }
            else if (tooltip.style.opacity) {
                tooltip.style.opacity = tooltipOpacity / 100;
            }
            setTimeout("hideTooltip()", 50);
        }
        else {
            tooltipOpacity = 0;
            tooltip.style.display = "none";
        }
    }
    function openmenu(n) {
        if (n == null) n = 0;
        else n = n - 1;
        var count = 0;
        var pb = PanelBar.firstChild;
        while (true) {
            if (pb.nodeName.toUpperCase() == "A") {
                if (count >= n) break;
                else count++;
            }
            pb = pb.nextSibling;
            if (pb == null) break;
        }

        if (pb != null) {
            setHotPanel(pb);
        }
    }

    function showmsgbox(text) {
        msgbox.rows[0].cells[0].innerHTML = "<div id=msg_text HIDEFOCUS=true tabindex=0 onblur=hidemsgbox(); style='padding:2px;'>" + text + "</div>";
        msgbox.style.display = "";
        document.getElementById("msg_text").focus();
        
        msgbox_opacity = 100;
        if (msgbox.style.filter != "undefined") {
            msgbox.style.filter = "Alpha(opacity = " + msgbox_opacity + ")";
        }
        else if (msgbox.style.opacity != "undefined") {
            msgbox.style.opacity = msgbox_opacity / 100;
        }
        clearTimeout(msgbox_handle);
        msgbox_handle=setTimeout('hidemsgbox()', 8000);
    }
    function hidemsgbox() {
        if (msgbox_opacity > 0) {
            msgbox_opacity -= 20;
            if (msgbox.style.filter != "undefined") {
                msgbox.style.filter = "Alpha(opacity = " + msgbox_opacity + ")";
            }
            else if (msgbox.style.opacity != "undefined") {
                msgbox.style.opacity = msgbox_opacity/100;
            }
            clearTimeout(msgbox_handle);
            msgbox_handle=setTimeout("hidemsgbox()", 100);
        }
        else {
            msgbox.style.display = "none";
        }
    }
    function hidelogo() {//显示隐藏logo
        if (logohided) {
            logohided = false;
            logo.firstChild.style.display = "";
            logo.style.height = "60px";
            notice.style.top = "43px";
        }
        else {
            logohided = true;
            logo.firstChild.style.display = "none";
            logo.style.height = "20px";
            notice.style.top = "3px";
        }
        doresize();
    }
    function hidesubmenu(hide) {//显示隐藏二级

        if (arguments.length == 1) {
            if (hide && !submenuhided) {
                var logoheight = 60;
                if (logohided) logoheight = 20;
                tooltip.style.top = (vsplit.clientHeight / 2 + logoheight - 35) + "px";
                if (tooltip.style.filter) {
                    tooltip.style.filter = "Alpha(opacity=80)";
                }
                else if (tooltip.style.opacity) {
                    tooltip.style.opacity = 0.8;
                }
                tooltipOpacity = 80;
                tooltip.style.display = "block";
                setTimeout("hideTooltip()", 3000);
            }
            submenuhided = !hide;
        }
        if (submenuhided) {
            submenuhided = false;
            vsplit.firstChild.className = "vsplitshow";
            submenutop.style.display = "";
            submenuview.style.display = "";
            tooltip.style.display = "none";
        }
        else {
            submenuhided = true;
            vsplit.firstChild.className = "vsplithide";
            submenutop.style.display = "none";
            submenuview.style.display = "none";
        }
    }

    function doresize() {//放缩窗口时对界面重新布局
        var w = document.documentElement.clientWidth;
        var h = document.documentElement.clientHeight;
        //        var w = document.body.clientWidth;
        //        var h = document.body.clientHeight;

        //document.title += " " + w + " " + h;
        backcover.style.width = w + "px";
        backcover.style.height = h + "px";

        backcover2.style.width = w + "px";
        backcover2.style.height = h + "px";
        
        dialog_login.style.height = Math.floor(h * 0.8) + "px";

        msgbox.style.left = (w / 2 - 130) + "px";
        msgbox.style.top = (h / 5 * 2 - 30) + "px";
        if (w > menubarwidth) {
            menuspace.width = w - menubarwidth;
        }
        var logoheight = 60;
        if (logohided) logoheight = 20;
        mainview.height = h - logoheight - 35;

        mainframe.height = mainview.height - 16;
        iMenuHeight = mainframe.height - Panels * 28 - 5;

        //swinbody.width = w - 38;
        swinbody.height = h - 62;
        swintitle.style.width = (w - 100) + "px";
    }

    function resetPanel(supermenu) {//设置二级菜单
        hotmenu.innerHTML = supermenu;
        PanelBar.innerHTML = "";
        Panels = 0;
        oExpending = null;
        oShrinking = null;
        oHotPanel = null;
        doresize();
        hidesubmenu(false);
    }
    function resetMenu(n) {
        document.getElementById("Panel_" + n).innerHTML = "";
    }

    function dialog_login_hide() {
        document.getElementById("backcover").style.display = "none";
        document.getElementById("dialog_login").style.display = "none";
    }
    function dialog_login_show() {
        document.getElementById("backcover").style.display = "";
        document.getElementById("dialog_login").style.display = "";
        document.getElementById("login_uid").focus();
    }
    function dialog_login_reset(r) {
        document.getElementById("login_uid").value = "";
        document.getElementById("login_pwd").value = "";
        document.getElementById("login_cod").value = "";
        document.getElementById("login_ref").value = r;
        document.getElementById("login_error").innerHTML = "·请登录获得更多权限，验证码不区分大小写，如果验证码不清晰请点击验证码图片。";
        document.getElementById("login_cim").src = "imgcode.aspx?" + Math.random();
        dialog_login_show();
    }
    function set_dialog_login_error(msg) {
        var login_error = document.getElementById("login_error");
        login_error.innerHTML = msg;
        login_error.scrollLeft = 200;
        dialog_login_show();
    }

    function dialog_login_hide() {
        document.getElementById("dialog_login").style.display = "none";
        backcover_hide();
    }

    function swin_close() {
        swin.style.display = "none";
        backcover_hide();
        var b = contents.document.getElementById("Button_Query");
        if (b) {
            b.fireEvent("onclick");
        }
        else {
            b = contents.document.getElementById("Button_Refresh");
            if (b) {
                b.fireEvent("onclick");
                
            }
        }
        hidemsgbox()
    }
    function swin_onload() {
        var t = swinframe.document.getElementById("wintop");
        if (t) {
            swintitle.innerHTML = "<img src='/GetIcon.ashx?f=" + swinframe.document.location.pathname + "' align=absmiddle width=16 height=16 style='margin-right:5px;'>" + t.innerHTML;
            t.style.display = "none";
        }
        swin_show();
    }
    function swin_show() {
        swin.style.display = "";
        backcover.style.display = "";
    }
    function swin_load(url) {
        swinbody.innerHTML = '<iframe id="swinframe" src="' + url + '" name="swinframe" width="100%" height="100%" border="0" frameborder="0" scrolling="yes" onload="swin_onload();"></iframe>';
    }
    function backcover_hide() {
        if (swin.style.display == "none" && document.getElementById("dialog_login").style.display == "none") {
            backcover.style.display = "none";
        }
    }
    
    function swin2_show() {
        swin2.style.display = "";
        backcover2.style.display = "";
    }
    function swin2_onload() {
        var t = swinframe2.document.getElementById("wintop");
        if (t) {
            swintitle2.innerHTML = "<img src='/GetIcon.ashx?f=" + swinframe2.document.location.pathname + "' align=absmiddle width=16 height=16 style='margin-right:5px;'>" + t.innerHTML;
            t.style.display = "none";
        }
        swin2_show();
    }
    function swin2_load(url, width, height,scrolling) {

        if (!scrolling) scrolling = "no";
        var top, left;
        var w = document.documentElement.clientWidth;
        var h = document.documentElement.clientHeight;

        if (width + 18 > w) {
            left = 5;
            width = w - 18;
        }
        else {
            left = Math.floor((w - width - 18) / 2);
        }
        if (height + 42 > h) {
            top = 5;
            height = h - 42;
        }
        else {
            top = Math.floor((h - height - 42) / 5*2);
        }
        
        swin2.style.left = left + "px";
        swin2.style.top = top + "px";

        swinbody2.innerHTML = '<iframe id=swinframe2 src="' + url + '" name=swinframe2 width=' + width + ' height=' + height + ' border=0 frameborder=0 scrolling=' + scrolling + ' onload=swin2_onload();></iframe>';
    }
    function swin2_close() {
        swin2.style.display = "none";
        backcover2.style.display = "none";
        if (swin.style.display != "none") return;
        var b = contents.document.getElementById("Button_Query");
        if (b) {
            b.fireEvent("onclick");
        }
        else {
            b = contents.document.getElementById("Button_Refresh");
            if (b) {
                b.fireEvent("onclick");
            }
        }
        hidemsgbox()
    }

</script>

<!--登录-->

<div class="backcover" id="backcover" style="display:none;"></div>
<table id="dialog_login" class="dialog_back" border="0" cellpadding="0" style="border-collapse: collapse;display:none;">
	<tr>
		<td align="center" valign="middle">　
            <form name="loginform" method="post" target="contents" action="Login.aspx" style="background-color:Transparent;">
                <input id="login_ref" type="hidden" name="ref" />
                <table class="dialog_login" border="0" cellpadding="0" style="border-collapse: collapse" width="320" height="230">
                    <tr>
	                    <td height="92" align="right" valign="top"><input type="button" class="button_login_close" onmouseover="this.style.backgroundPositionY=20; " onmouseout="this.style.backgroundPositionY=0;" onclick="dialog_login_hide();" /></td>
                    </tr>
                    <tr>
	                    <td class="loginfield">工　号：<input id="login_uid" name="uid" class="loginfield" style="width:144px;" onkeypress="checkEnter" /></td>
                    </tr>
                    <tr>
	                    <td class="loginfield">密　码：<input id="login_pwd" name="pwd" type="password" class="loginfield" style="width:144px;" /></td>
                    </tr>
                    <tr>
	                    <td class="loginfield">验证码：<input id="login_cod" name="cod" class="loginfield" style="width:80px;" /><img id="login_cim" style="margin:0px 0px 0px 10px;" src="imgcode.aspx" align="middle" onclick="this.src='imgcode.aspx?'+Math.random();"/></td>
                    </tr>
                    <tr>
	                    <td height="45"><marquee id="login_error" behavior="alternate" scrollamount="8" scrolldelay="200" style="width:200px;text-align:left;color:#993c39;margin-left:15px;font-size:14px;" onmouseover="this.stop();" onmouseout="this.start();" ></marquee><input type="button" class="button_login" value="" onclick="loginform.submit();" /></td>
                    </tr>

                </table>
            </form>
        </td>
    </tr>
</table>

<!--弹出大窗-->
<table id="swin" border="0" cellpadding="0" style="border-collapse: collapse;display:none;">
	<tr>
		<td class="swin-top-left"></td>
		<td class="swin-top"><div id="swin-title"></div></td>
		<td class="swin-top" valign="top"><input type="button" class="swin-close" onclick="swin_close();" onmouseover="this.style.backgroundPositionY=20; " onmouseout="this.style.backgroundPositionY=0;" /></td>
		<td class="swin-top-right"></td>
	</tr>
	<tr>
		<td class="swin-left"></td>
		<td id="swin-body" colspan="2" bgcolor="#ffffff"><iframe id="swinframe" src="blank.htm" name="swinframe" width="100%" height="100%" border="0" frameborder="0" scrolling="yes"></iframe></td>
		<td class="swin-right"></td>
	</tr>
	<tr>
		<td class="swin-bottom-left"></td>
		<td class="swin-bottom" colspan="2"></td>
		<td class="swin-bottom-right"></td>
	</tr>
</table>


<!--弹出小窗-->
<div class="backcover" id="backcover2" style="display:none; z-index:4;filter:Alpha(opacity=30);opacity:0.3;"></div>
<table id="swin2" border="0" cellpadding="0" style="border-collapse: collapse;display:none;">
	<tr>
		<td class="swin2-top-left"></td>
		<td id="swin2-top" class="swin2-top" valign=top><div id="swin2-title"></div><input type="button" class="swin2-close" onclick="swin2_close();" onmouseover="this.style.backgroundPositionY=20; " onmouseout="this.style.backgroundPositionY=0;" /></td>
		<td class="swin2-top-right"></td>
	</tr>
	<tr>
		<td class="swin2-left"></td>
		<td id="swin2-body" bgcolor="#ffffff"></td>
		<td class="swin2-right"></td>
	</tr>
	<tr>
		<td class="swin2-bottom-left"></td>
		<td class="swin2-bottom"></td>
		<td class="swin2-bottom-right"></td>
	</tr>
</table>

<!--Msgbox-->
<table id="msgbox" style="display:none;">
<tr><td height="50" style="padding:2px 7px 2px 6px;"></td></tr>
</table>

<!--Logo-->
<div id="logo" ondblclick="hidelogo();"><div id="logoimg"></div></div>

<!--系统提示-->
<div id="notice" ondblclick="hidelogo();"><a id="adesktop" class="a1" href="Desktop.aspx" onclick="if(this.innerHTML=='登录'){dialog_login_reset('Desktop.aspx');return false;}"></a>&nbsp;&nbsp;<%=DateTime.Today.ToLongDateString() %></div>

<!--主菜单-->
<table id="menubar" ondblclick="hidelogo();">
	<tr>
		<td id="hotmenu" nowrap onclick="return;hidelogo();hidesubmenu();">我的首页</td>
		<td class="mm" nowrap><a class="a1" href="ScHome.aspx">生产管理</a></td>
		<td class="mm" nowrap><a class="a1" href="FcHome.aspx">分厂管理</a></td>
		<td class="mm" nowrap><a class="a1" href="SaleHome.aspx">采购管理</a></td>
		<td class="mm" nowrap><a class="a1" href="XsHome.aspx">销售管理</a></td>
		<td class="mm" nowrap><a class="a1" href="StoreHome.aspx">物料中心</a></td>
		<td class="mm" nowrap><a class="a1" href="SbjdHome.aspx">设备机动</a></td>
		<td class="mm" nowrap><a class="a1" href="JszlHome.aspx">技术质量</a></td>
		<td class="mm" nowrap><a class="a1" href="JcfxHome.aspx">决策分析</a></td>
		<td class="mm" nowrap><a class="a1" href="CwhsHome.aspx">财务核算</a></td>
		<td class="mm" nowrap><a class="a1" href="SettingsHome.aspx">基础数据</a></td>
		<td class="mm" nowrap><a class="a1" href="AdminHome.aspx">系统维护</a></td>

		<td class="mm" nowrap></td>
		<td id="menuspace"></td>
		<td class="mmexit" nowrap>
		<a class="a1" target="_top" href="Exit.aspx">退出</a></td>
	</tr>
</table>

<!--主菜单与子菜单间隔-->
<div id="hsplit">
    <table width="172" height="3">
	    <tr>
		    <td id="submenutop" class="splittd1"></td>
		    <td class="splittd2"></td>
	    </tr>
    </table>
</div>

<!--二级菜单主显示区域-->
<table id="mainview">
	<tr>
		<td id="submenuview" align="center" valign= "top"><div id="PanelBar" style="background-color:#84271d;border:1px solid #9f9b90;width:150px;"></div></td>
		<td id="vsplit" onclick="hidesubmenu();" title="点击这里可[显示]或[隐藏]菜单栏"><div class="vsplitshow"></div></td>
		<td style="padding:8px 6px 6px 1px;" valign="top">

		<iframe id="mainframe" name="contents" width="100%" border="0" frameborder="0" src="blank.htm" scrolling="yes"></iframe>
		
		</td>
	</tr>
</table>
</body>
<script language="javascript">
    var TreeHTML = "";

    var logohided = false;
    var submenuhided = false;
    var logo = document.getElementById("logo");
    var notice = document.getElementById("notice");
    var menubar = document.getElementById("menubar");
    var hotmenu = document.getElementById("hotmenu");

    var menubarwidth = menubar.clientWidth;
    var menuspace = document.getElementById("menuspace");
    var mainview = document.getElementById("mainview");
    var submenuview = document.getElementById("submenuview");

    var mainframe = document.getElementById("mainframe");
    var submenutop = document.getElementById("submenutop");
    var vsplit = document.getElementById("vsplit");

    var msgbox = document.getElementById("msgbox");
    var msgbox_opacity = 80;
    var msgbox_handle = 0;
    
    var dialog_login = document.getElementById("dialog_login");
    var backcover = document.getElementById("backcover");
    var backcover2 = document.getElementById("backcover2");

    var swin = document.getElementById("swin");
    var swinbody = document.getElementById("swin-body");
    var swintitle = document.getElementById("swin-title");

    var swin2 = document.getElementById("swin2");
    var swinbody2 = document.getElementById("swin2-body");
    var swintitle2 = document.getElementById("swin2-title");

    var swin2_top = document.getElementById("swin2-top");
    var swin2_moving = false;

    swin2_top.onmousedown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName.toUpperCase() != "INPUT") {
            if (this.setCapture) this.setCapture();
            swin2_moving = true;
        }

    };
    swin2_top.onmouseup = function(e) {
        if (this.releaseCapture) this.releaseCapture();
        swin2_moving = false;
    };

    swin2_top.onmousemove = function(e) {
        if (!e) e = window.event;
        if (swin2_moving) {
            if (e.clientX > 0 && e.clientY > 0) {
                swin2.style.left = (e.clientX - (this.clientWidth / 2)) + "px";
                swin2.style.top = (e.clientY - (this.clientHeight / 2)) + "px";
            }
        }
    };
 

    var tooltip = document.getElementById("tooltip");
    var tooltipOpacity = 80;

    var PanelBar = document.getElementById("PanelBar");

    window.onresize = doresize;
    //doresize();

    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "loginfield") {

            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }

    for (var i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "textbox") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    document.body.onkeypress = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.className.toLowerCase() != "loginfield") return;
        var i;
        if (e.keyCode == 13) {
            for (i = 0; i < textboxs.length; i++) {
                if (tag == textboxs[i]) {
                    textboxs[i + 1].focus();
                }
            }
        }
    };
    mainframe.src = "<%=Home%>";
</script>
</html>
